﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace A2DFramework.LockService
{
    public interface ILockProvider
    {
        /// <summary>
        /// 生成锁，并且获得锁，并且返回包装后的锁对象
        /// </summary>
        /// <param name="lockName"></param>
        /// <returns></returns>
        IDisposable AcquireLock(string lockName, TimeSpan timeout);

        /// <summary>
        /// 释放锁
        /// </summary>
        /// <param name="lockName"></param>
        void ReleaseLock(IDisposable lockObj);
    }
}
